﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EnumerationTest
{
    public class MyCollectionGeneric : IEnumerable<int>
    {

        private int[] data = { 1, 2, 3 };
        public IEnumerator<int> GetEnumerator()
        {
            foreach (var value in data)
            {
                yield return value;
            }
        }

        IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
    }
}
